<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Template • TodoMVC</title>
    <link rel="stylesheet" href="node_modules/todomvc-common/base.css">
    <link rel="stylesheet" href="node_modules/todomvc-app-css/index.css">
    <style>
        [ng-cloak]{
            display:none;
        }
    </style>
</head>
<script src="js/angular.js"></script>
<script src="js/app-练习.js"></script>
<body>
    <section class="todoapp" ng-app="todoApp" ng-controller="todoCtrl" ng-cloak>
        <header class="header">
            <h1>todos</h1>
            <form ng-submit="add()">
                <input ng-model="text" class="new-todo" placeholder="What needs to be done?" autofocus>
            </form>
        </header>
        <!-- This section should be hidden by default and shown when there are todos -->
        <section class="main">

            <input ng-show="isAllShow" class="toggle-all" type="checkbox" ng-click="todoAllChoose()" ng-model="allToggle">
            <!--<label for="toggle-all">Mark all as complete</label>-->
            <ul class="todo-list">
                <!-- These are here just to show the structure of the list items -->
                <!-- List items should get the class `editing` when editing and `completed` when marked as completed -->
                <li ng-repeat="item in todoList | filter:todoFilter" ng-class="{completed:item.isCompleted,editing:item.id==editingID}">
                    <div class="view">
                        <!--要绑定item.isComputed,让todoList里面的数据跟着checkbox一起变化-->
                        <input class="toggle" type="checkbox" ng-model="item.isCompleted">
                        <!--动态生成的数据不具有双向绑定性?-->
                        <!--<input type="text" ng-model="newText">-->
                        <label ng-dblclick="edit(item)">{{item.text}}</label>
                        <!--传入对应的数据-->
                        <button class="destroy" ng-click="del(item)"></button>
                    </div>
                    <input class="edit" ng-model="item.text" autofocus ng-blur="edited(item)">
                </li>
            </ul>
        </section>
        <!-- This footer should hidden by default and shown when there are todos -->
        <footer class="footer" ng-show="isAllShow">
            <!-- This should be `0 items left` by default -->
            <span class="todo-count"><strong>{{todoCount}}</strong> item left</span>
            <!-- Remove this if you don't implement routing -->
            <ul class="filters">
                <li>
                    <a  href="#/" ng-click="todoChangeFilter(0)" ng-class="{selected:todoFilter.isCompleted==undefined}">All</a>
                </li>
                <li>
                    <!--比较对象是否相等是比较地址-->
                    <a href="#/active" ng-click="todoChangeFilter(1)" ng-class="{'selected':todoFilter.isCompleted==false}">Active</a>
                </li>
                <li>
                    <a href="#/completed"ng-click="todoChangeFilter(2)" ng-class="{'selected':todoFilter.isCompleted==true}">Completed</a>
                </li>
            </ul>
            <!-- Hidden if no completed items are left ↓ -->
            <button ng-show="isCompletedShow" class="clear-completed" ng-click="todoClearCompleted()">Clear completed</button>
        </footer>
    </section>
    <footer class="info">
        <p>Double-click to edit a todo</p>
        <p>Created by <a href="http://todomvc.com">itcast</a></p>
        <p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
    </footer>

</body>

</html>
